package wordeditor.editors;

import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IWhitespaceDetector;
import org.eclipse.jface.text.rules.RuleBasedScanner;
import org.eclipse.jface.text.rules.SingleLineRule;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.rules.WhitespaceRule;
import org.eclipse.swt.widgets.Display;

class WordEditorScanner extends RuleBasedScanner {
	
    public WordEditorScanner(ColorManager manager) {
    	System.out.println("FicheReleaseScanner a" );
       Token modelToken	= new Token(new TextAttribute(manager.getColor(ColorConstants.MODELE)));       
       TeteWordRule modelWordRule = new TeteWordRule(modelToken);
       
       setRules(new IRule[] {
          modelWordRule,
          new ReponseWordRule(new Token(new TextAttribute(manager.getColor(ColorConstants.REPONSE)))),
          new WhitespaceRule(new IWhitespaceDetector() {
             public boolean isWhitespace(char c) {
                return Character.isWhitespace(c);
             }
          }),
          
       });
    }
    
 }
